<template>
    <div class="content">
        <router-link to="/app/adminManager"><el-button  icon="information">管理员列表</el-button></router-link>
        <router-link to="/app/needAddBook"><el-button  icon="circle-check">需添加的小说</el-button></router-link>
        <el-table
                :data="tableData"
                border
                style="width: 100%">
            <el-table-column
                    prop="bookName"
                    label="书籍名称"
                    width="130px">
            </el-table-column>
            <el-table-column
                    prop="author"
                    label="作者"
                    width="130px">
            </el-table-column>
            <el-table-column
                    prop="style"
                    label="类型"
                    width="170px">
            </el-table-column>
            <el-table-column
                    prop="status"
                    label="状态"
                    width="170px">
            </el-table-column>
            <el-table-column
                    label="操作"
                    width="130">
                <template scope="scope">
                    <el-button @click="deleteAdmin(scope.row)" type="text" size="small">删除</el-button>
                </template>
            </el-table-column>
        </el-table>
    </div>
</template>
<script>
    import { Message } from 'element-ui';
    import util from 'utility';
    export default {
        data:function(){
            return {
                accountTips:"",
                passTips:"",
                confirmTips:"",
                addAdminForm: {
                    bookName: '',
                    author: '',
                    style: '',
                    status:''
                },
                tableData:[]
            }
        },
        methods:{
            //获取所有管理员
            getAllAdmin(){
                this.$http.get('http://localhost/api/needAddBook').then(function (result) {
                    this.tableData = result.body;
                })
            }
        },
        created:function () {
            this.getAllAdmin();
        }
    }
</script>
<style scoped>
    .content{
        padding:20px 740px 0 20px;
    }
    .content>.title{
        font-size: 20px;
        font-weight: 600;
        margin-bottom: 40px;
        margin-left: 98px;
        margin-top: 20px;
    }
</style>